83Plus:BCALLs:40A5: Difference between revisions

From WikiTI
Jump to navigationJump to search
No edit summary
 
Line 15: Line 15:
=== Destroys ===
=== Destroys ===
* AF, BC, DE, HL
* AF, BC, DE, HL
=== Comments ===
* If you do not want to round and would like to find the floor of OP1, you can use [[83Plus:BCALLs:4060|Trunc]]


== Example ==
== Example ==

Latest revision as of 18:14, 14 October 2005

Synopsis

Official Name: Int

BCALL Address: 40A5

Rounds OP1 to an integer.

Inputs

  • OP1 = floating point

Outputs

  • OP1 = OP1 rounded to an integer

Destroys

  • AF, BC, DE, HL

Comments

  • If you do not want to round and would like to find the floor of OP1, you can use Trunc

Example

B_CALL OP1Set3  ;OP1=floating point 3
B_CALL SqRoot  ;returns with OP1=floating point 1.7320508075689
B_CALL Int  ;returns with OP1=2