Hacker News new | past | comments | ask | show | jobs | submit login

Looks like you're right. In my defense the page I linked states that The / operator is defined only for the Decimal, Single, and Double data types. I suppose it accepts integer types by means of 'widening'?

> Did you read it?

The HN guidelines ask that you don't do that.




I've edited my comment for guideline compliance.

I don't think it settles anything, but a trivial function that divides two integers and returns the result compiles to this:

  IL_0000:  ldarg.1     
  IL_0001:  conv.r8     
  IL_0002:  ldarg.2     
  IL_0003:  conv.r8     
  IL_0004:  div         
  IL_0005:  ret        

conv.r8 is an explicit conversion to double precision float in the target language, MSIL.


I was already convinced by your earlier tio.run example, but I'm still a bit baffled by the page saying The / operator is defined only for the Decimal, Single, and Double data types.




Join us for AI Startup School this June 16-17 in San Francisco!

Guidelines | FAQ | Lists | API | Security | Legal | Apply to YC | Contact

Search: