LabVIEW Idea Exchange

cancel
Showing results for 
Search instead for 
Did you mean: 
RavensFan

Round towards Zero Primitive

Status: New

We have a Round towards -Infinity  (3.8 becomes 3,  -3.8 becomes -4)

We have a Round towards +Infinity (3.2 becomes 4, -3.2 becomes 3)

We have a Round to Nearest (Rounds up or down to nearest integer, if 0.5, banker's rounding to even integer)

 

Why is there no Round towards Zero?  Basically a truncate.  (3.2 becomes 3, -3.2 becomes -3)

I have a use for that right now, but it takes several primitives to work. 

 

As a corollary, a Round Away from Zero.  (3.2 becomes 4, -3.2 becomes -4)

 

 

Message Edited by Ravens Fan on 01-19-2010 04:53 PM
3 Comments
Lavezza
Active Participant

Not as pretty as a regular primitive, but the expression node supports a function that does what you need, intrz(x)

 

intrz.png

FredTest
Member

Cant use the intrz(x) function in LV 2010

Dennis_Knutson
Knight of NI

"Cant use the intrz(x) function in LV 2010"

 

Yes you can.