Difference between revisions of "83Plus:BCALLs:4093"

From WikiTI
Jump to: navigation, search
 
(No difference)

Latest revision as of 14:55, 25 April 2005

Synopsis

Official Name: Frac

BCALL Address: 4093

Finds the fractional part of OP1 and returns the value in OP1.

Inputs

  • OP1 = floating point

Outputs

  • OP1 = OP1-int(OP1)

Destroys

  • AF, HL

Comments

This is similar to the BASIC function fPart(). For negative numbers, the sign bit will remain.

Example

B_CALL OP1Set3  ;OP1=floating point 3
B_CALL Op1Set2  ;op2=floating point 2
B_CALL FPDiv  ;op1=1.5
B_CALL Frac  ;returns with OP1=floating point 0.5