[erlang-questions] How to define non_neg_float() type specification?

Stavros Aronis aronisstav@REDACTED
Thu Sep 27 18:32:47 CEST 2012


Hello!

Unfortunately Dialyzer does not support it (even constants are generalized 
to any float, typwise). Consequentially, the type language does tnot 
support it. 
You can maybe try:

-type define non_neg_float() :: float().

This will help you documentation-wise and also (though in a somewhat 
limited way) Dialyzer-wise. If you use this type PropEr-wise however, you 
will get positive values, which you will need to filter...

Stavros

On Thursday, September 27, 2012 6:10:14 PM UTC+2, Zhemzhitsky Sergey wrote:
>
>  Hello erlangers,
>
>  
>
> Is it possible to define non_neg_float() type specification somehow?
>
>  
>
> Best Regards,
>
> Sergey
>
>  
>  
> _______________________________________________________
>
>  
>
> The information contained in this message may be privileged and conf 
> idential and protected from disclosure. If you are not the original 
> intended recipient, you are hereby notified that any review, 
> retransmission, dissemination, or other use of, or taking of any action in 
> reliance upon, this information is prohibited. If you have received this 
> communication in error, please notify the sender immediately by replying to 
> this message and delete it from your computer. Thank you for your 
> cooperation. Troika Dialog, Russia. 
>
> If you need assistance please contact our Contact Center (+7495) 258 0500 
> or go to www.troika.ru/eng/Contacts/system.wbp 
>
>  
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://erlang.org/pipermail/erlang-questions/attachments/20120927/b9d82420/attachment.htm>


More information about the erlang-questions mailing list