83Plus:BCALLs:40A8

From WikiTI
Jump to: navigation, search

Synopsis

Official Name: Round

BCALL Address: 40A8

Rounds OP1 to the Nth decimal place where N is specified by register D.

Inputs

  • D = number of decimal digits to round to
  • OP1 = floating point

Outputs

  • OP1 = OP1 rounded to an integer

Destroys

  • AF, BC, HL

Example

B_CALL OP1Set3  ;OP1=floating point 3
B_CALL SqRoot   ;returns with OP1=floating point 1.7320508075689
ld d,2
B_CALL Round    ;returns with OP1=1.73