I would agree that this is not quite as expected. In the generated C code, the 
47.11'f32 literal becomes 4.7109999999999999e+01, i.e., it has higher precision 
than `y`. One might think that an explicit conversion should help, but I think 
it is optimised away. If you need a work-around, wrapping the conversion in a 
function does work:
    
    
    proc forceF32[T](x: T): float32 = x.float32
    
    let y: float32 = 47.11'f32 # the 'f32 actually doesn't matter
    assert forceF32(47.11'f32) == y # ok
    assert float32(47.11'f32) == y # fails
    

Reply via email to