Hacker Newsnew | past | comments | ask | show | jobs | submitlogin

There is no elegant solution in Rust to make something like

  type Temperature_K is digits 6 range 0 .. <whatever is reasonable upper bound in your domain>;


at least that is an unsigned (though there are no usigned hardware floats). If you said tempemerature C there you range starts at -273.15 and you want errors of some sort to happen if you go below that.


Ideally, the program would freeze




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

Search: