forum-msg-id-128799-edit

Original date:2015-10-07 09:18:51 Edited by: bugmagnet Subject: problem with euc on

I'm using

Euphoria to C Translator v4.1.0 development 
   64-bit Windows, Using System Memory 
   Revision Date: 2015-02-02 14:18:53, Id: 6300:57179171dbed 
and I've just compiled the following .ex file to .exe

include std/math.e  
include std/convert.e 
 
function Bin(integer n, sequence s = "") 
  if n > 0 then 
   return Bin(floor(n/2),(mod(n,2) + #30) & s) 
  end if 
  if length(s) = 0 then 
   return to_integer("0") 
  end if 
  return to_integer(s) 
end function 
 
printf(1, "%d\n", Bin(0)) 
printf(1, "%d\n", Bin(5)) 
printf(1, "%d\n", Bin(50)) 
printf(1, "%d\n", Bin(9000)) 

When I run that with eui.exe I get

>eui bin.ex 
0 
101 
110010 
10001100101000 
but when I run the exe, I get
>bin.exe 
0 
0 
0 
0 
As Julius Sumner Miller used to say, "Why is it so?"

bugmagnet

Not Categorized, Please Help

Search



Quick Links

User menu

Not signed in.

Misc Menu