Have you seen the example at
https://github.com/JuliaLang/julia/blob/master/examples/modint.jl ?
Best, 
Moritz

Am Sonntag, 28. Februar 2016 16:33:07 UTC+1 schrieb Kevin Kunzmann:
>
> Hey,
>
> I have a (probably) very simple question. I would like to define 
> 'Probability' as a new subtype of 'Real', only with the additional 
> restriction that the value must be between 0 and 1. How would I achieve 
> that 'Julia-style'? This should be possible without having to rewrite all 
> these promotion rules and stuff, is it not? 
>
> Best Kevin
>

Reply via email to