Created attachment 94527 [details] spreadsheet with macros vestocastic() and vestocastic2() tested from libreoffice 3.6 in windows x32/64 and ubuntu x32/64 Function vEstocastic (vector()) as boolean dim i, m as integer dim suma as variant suma = 0 m = ubound(vector, 2) for i = 1 to m suma = suma + vector(1, i) next if suma = 1 then 'if the variable suma = 1 vEstocastic = true 'somtimes is true else 'and vEstocastic = false 'sometimes is false end if End Function and..... Function eNumeric (elemento) as boolean if isnumeric(elemento) then 'if elemento = .0.3 eNumeric = true 'the result is incorrectly true else eNumeric = false ' end if End Function
Created attachment 94528 [details] screenshot with example
Hi jharaquem, thanks for reporting. Maybe it is related to http://en.wikipedia.org/wiki/Floating_point#IEEE_754:_floating_point_in_modern_computers Please try rounding suma equation, perhaps can help.
I do not think that is related, i've also tried to change the type of variables and nothing I tried with the values { 0.7 0.2 0.1 0 } whose sum is 1.0 in different order, and does not work. and ".0.3" not is numeric, in the case of vnumeric function please verify the attachments and try macros this is my first report sorry for my english :)
Sorry I can't help with macros.
basic rule in computational programming: it is always a bad idea to compare a floating number to an integer for equality. Please ask for help on macro on askLibo or on the users mailing list. Closing as NotOurBug. Best regards. JBF