Rank: Newbie
Groups: Registered
Joined: 09/09/2010(UTC) Posts: 4 Location: San Diego
Was thanked: 2 time(s) in 1 post(s)
|
I want to do the following:
length := 16 in
diameter := trunc(((length + 2 in)/pi)in)
diameter = 7.0000 in
I need to be able to set the result of a parenthesis-enclosed expression to inch units, then apply the trunc() function to it, retaining the units as inches. At the moment, it seems as though it is only possible to apply the trunc() function to the results of computation in parenthesis using SI units, so the result becomes 0 because the value of (length + 2 in)/pi is 0.1779 m.
The workaround seems to be to not use units at all, but that is not nearly as nice.
|
|
|
|
Rank: Administration Groups: Registered, Advanced Member Joined: 23/06/2009(UTC) Posts: 1,740 Was thanked: 318 time(s) in 268 post(s)
|
Hello, What about this The argument inside "trunc" divide by the desired unit (in - in this case). Then, the entire expression multiply by the desired unit (in - in this case) In general, when you do not want SI units - divide the expression by the desired unit. Then you will get the dimensionless number with the value in the desired unit. Regards, Radovan Edited by user 09 September 2010 11:43:59(UTC)
| Reason: Not specified |
When Sisyphus climbed to the top of a hill, they said: "Wrong boulder!" |
|
|
|
Rank: Newbie
Groups: Registered
Joined: 09/09/2010(UTC) Posts: 4 Location: San Diego
Was thanked: 2 time(s) in 1 post(s)
|
This worked well. Thank you!
|
|
|
|
Forum Jump
You cannot post new topics in this forum.
You cannot reply to topics in this forum.
You cannot delete your posts in this forum.
You cannot edit your posts in this forum.
You cannot create polls in this forum.
You cannot vote in polls in this forum.