Difference between revisions of "83Plus:BCALLs:405D"
From WikiTI
m (OP2 link fixed) |
(official name, category) |
||
(One intermediate revision by one other user not shown) | |||
Line 1: | Line 1: | ||
− | [[Category:83Plus:BCALLs:By Name| | + | [[Category:83Plus:BCALLs:By Name|Intgr]] [[Category:83Plus:BCALLs:By Name:FP Math|Intgr]] [[Category:83Plus:BCALLs:By Address|405D - Intgr]] |
− | [[Category:83Plus:BCALLs:By Name:Math| | + | |
− | [[Category:83Plus:BCALLs:By Address|405D - | + | |
== Synopsis == | == Synopsis == | ||
+ | '''Official Name:''' Intgr | ||
+ | |||
'''Unofficial Name:''' Floor | '''Unofficial Name:''' Floor | ||
'''BCALL Address:''' 405D | '''BCALL Address:''' 405D | ||
− | Calculates the floor of the value in [[83Plus:RAM:8478|OP1]], and stores it in [[83Plus:RAM:8478|OP1]]. Floor is rounding down to the nearest integer, e.g. floor(3.5) = 3 and floor(-4.0001) = - | + | Calculates the floor of the value in [[83Plus:RAM:8478|OP1]], and stores it in [[83Plus:RAM:8478|OP1]]. Floor is rounding down to the nearest integer, e.g. floor(3.5) = 3 and floor(-4.0001) = -5. |
=== Inputs === | === Inputs === |
Latest revision as of 19:14, 29 September 2009
Synopsis
Official Name: Intgr
Unofficial Name: Floor
BCALL Address: 405D
Calculates the floor of the value in OP1, and stores it in OP1. Floor is rounding down to the nearest integer, e.g. floor(3.5) = 3 and floor(-4.0001) = -5.
Inputs
- OP1: Number to take floor of
Outputs
- OP1 contains floor
Destroys
Comments
This BCALL calculates the floor of the value in OP1 by taking the fractional part, reversing its sign, and adding it to the original value.
Example
ld a,3 B_CALL SetXXOP1 B_CALL TimesPt5 ;OP1 is 1.5 B_CALL Floor ;OP1 is now 1