Function test(a)
test = -a
End Function
Jerry
I think it is because you have not declared your function type, so it assume
variant
Try this and it works as you would expect
Function test(a) As Long
test = -a
End Function
--
HTH
Bob Phillips
... looking out across Poole Harbour to the Purbecks
"Jerry W. Lewis" <post_a_reply@no_e-mail.com> wrote in message
news:3DEF479F.4020003@no_e-mail.com...
In article <3DEF479F.4020003@no_e-mail.com>, Jerry W. Lewis
Function test(a As Double) As Double
test = -a
End Function
still returns -0. The Locals window shows the value to be 0 just before
return. I have only been able to produce -0 when the worksheet
interacts with VBA. Strictly within a worksheet or strictly within VBA
it does not seem possible.
Jerry
in an Excel (97, 2000, or XP) worksheet =(test(0)<0) returns True, and
=(test(0)=0) returns False.
Jerry
> XLv.X?
XL v.X for Macintosh
Worked ok for me (xl2002). Something about the unary operator??
There's been a few discussions about this kind of stuff. I searched google and
found a partial thread that you may want to look at. (not sure if it'll help,
but you may find it, er, exasperating.)
http://groups.google.com/groups?threadm=d2c023b0.0204021139.48592e1e%40posting.google.com
(one line in your browser)
--
Dave Peterson
ec3...@msn.com