Here's an example of a case where I'd like some formatting in MATH box expressions:Code: [Select]((Drum[V0] | IF(MHR7:0 & C201, RelayWDCfg0:SD, 0)) & IF(C103, -1, RelayPanicCfg0:SD) &
IF(ST4, ~RelayFlashCfg0:SD, -1) & ~RelayTypeTOD0:SD) | (RelayTypeTOD0:SD & TODOutputs0:SD)
Actually doesn't look too bad on screen but hard to follow scrunched up in a little MATH edit box or at runtime.
IF(X0, 1.1, 2.2) | IF(X1, 4.4, 8.8)| X0 X1 R0 0 0 10.0 0 1 6.0 1 0 9.0 1 1 5.0 |
should be
X0 X1 R0
0 0 10.0
0 1 6.0
1 0 9.0
1 1 5.0
should be
X0 X1 R0
0 0 10.0
0 1 6.0
1 0 9.0
1 1 5.0
IF(X0, IF(X1, 5.0, 9.0), IF(X1, 6.0, 10.0))
But my question is more "why is the truncation and summing even happening?"In your version, you are bit-wise OR-ing floating point numbers. That is not a good idea. Only do bit-wise operations on integer types.
"why is the truncation and summing even happening?"
Big disappointment.
Just out of curiosity I had to try it. The bitwise OR of 5.0 and 2.0 is ... 5.0 Big disappointment.
Byte extraction casts! I was hoping they were there and when I checked sure enough they were! Why do we not have a thumbs-up emoticon??
Feature request: Restore our ability when viewing numeric memory locations in ASCII mode in a Data View to specify how many registers (or characters) to show on a line (like DS5 behavior).That's what STRINGs are for. You get a lot more ASCII display capabilities using STRINGs.
Feature request: Restore our ability when viewing numeric memory locations in ASCII mode in a Data View to specify how many registers (or characters) to show on a line (like DS5 behavior).That's what STRINGs are for. You get a lot more ASCII display capabilities using STRINGs.
Agreed, BobO. I don't think anyone's contending that it should be any different than it is; we were assuming that it did bitwise ops on the bits as is, and that therefore the user simply shouldn't be using bit ops on floating point arguments. Turns out you've cushioned it a little bit for the guys doing the stuff they're not supposed to be doing. Any further discussion was just learning how it worked in detail (because it's interesting and to avoid using it for something it won't do, and even unanticipated behavior can be useful once you understand the rules). No worries!
R101 | R102 != R101:S | R102:S
When we have an arbitrary choice of how to deal with an exception condition, we try to choose the way that takes the pointy stick away from the noob.
When we have an arbitrary choice of how to deal with an exception condition, we try to choose the way that takes the pointy stick away from the noob.
You're no fun -- pointy sticks are what chlorinate the gene pool! :D