Hello Guest it is March 29, 2024, 10:09:05 AM

Author Topic: Easy way to always have a positive value in a DRO field  (Read 3605 times)

0 Members and 1 Guest are viewing this topic.

Offline Tarak

*
  •  229 229
    • View Profile
Easy way to always have a positive value in a DRO field
« on: May 09, 2008, 05:34:31 AM »
Is there an easy way to always force a positive value into a DRO, I have a small calculator I've made for working out a lead (similar to a drill flute), it works great but it returns a negative value.
Is it possible to change the following line to make it always output a positive value?

SetOEMDRO (1203,3.141592654*Ø/Tan(AngleinRadians)) 'This normally works out to a negative value, but the value in a positive is correct.

Offline poppabear

*
  • *
  •  2,235 2,235
  • Briceville, TN, USA
    • View Profile
Re: Easy way to always have a positive value in a DRO field
« Reply #1 on: May 09, 2008, 08:30:35 AM »
Yes,

x=ABS(SetOEMDRO (1203,3.141592654*Ø/Tan(AngleinRadians)))

Absoulte value function, always positive.

scott
fun times

Offline Tarak

*
  •  229 229
    • View Profile
Re: Easy way to always have a positive value in a DRO field
« Reply #2 on: May 09, 2008, 04:57:58 PM »
Yet again, Thanks scott, works well. Now that I look at the function Abs, I think you may of told me this once before, sorry.
Darc