absolute function

new topic     » topic index » view thread      » older message » newer message

The Euphoria absolute function in math.e looks too old-fashioned. The following seems to work as well and might be faster. The outer brackets can probably be omitted. It takes care of atom and sequence arguments

 
public function newabs (object s ) 
      return s + ( s * -2 * ( s < 0 ) ) 
end function 
 
new topic     » topic index » view thread      » older message » newer message

Search



Quick Links

User menu

Not signed in.

Misc Menu