Qestion about round up

General APL language issues

Qestion about round up

Postby bilekflo on Mon Mar 28, 2022 2:05 pm

May be a silly question but why does

⌈⍬ or ⌈⍳0 (numeric empty vector) delivers
¯1.797693135E308 and not an numeric empty vector?

BR Florian
bilekflo
 
Posts: 28
Joined: Wed Mar 12, 2014 10:07 pm

Re: Qestion about round up

Postby petermsiegel on Mon Mar 28, 2022 3:58 pm

For ⌈⍬, the result is .

Do you mean ⌈/⍬? The result is based on the definition of reduce / for null elements in the argument; reduce uses the identity element when the operand is the maximum function , here the biggest negative number defined (for the current ⎕FR), or a special value for , and , else a DOMAIN ERROR.

See page 162 of the Dyalog APL Language Reference Guide for the formal definition, which isn't easy to parse.

Cheers.

For amusement:
      ⌈/2 3 0⍴0
¯1.797693135E308 ¯1.797693135E308 ¯1.797693135E308
¯1.797693135E308 ¯1.797693135E308 ¯1.797693135E308
petermsiegel
 
Posts: 140
Joined: Thu Nov 11, 2010 11:04 pm

Re: Qestion about round up

Postby bilekflo on Tue Mar 29, 2022 7:40 pm

Thank you for explanation. I wasn't aware of this.

BR Florian
bilekflo
 
Posts: 28
Joined: Wed Mar 12, 2014 10:07 pm


Return to Language

Who is online

Users browsing this forum: No registered users and 1 guest