9front - general discussion about 9front
 help / color / mirror / Atom feed
* pc(1): integer-only entry
@ 2017-07-01 12:28 Ethan Grammatikidis
  2017-07-01 12:51 ` [9front] " Ethan Grammatikidis
  0 siblings, 1 reply; 2+ messages in thread
From: Ethan Grammatikidis @ 2017-07-01 12:28 UTC (permalink / raw)
  To: 9front

pc's man page says "Pc is an arbitrary precision calculator", but it responds to my attempts to enter non-integers by reporting 'syntax error', truncating them, or outright ignoring them. if there was a way to set the precision (as in dc and bc) then at least truncation would make sense, but there's nothing on the subject in the man page. it's also inconsistent on whether it ignores or reports a syntax error.

; 1. / 3.
syntax error
; 1.0 / 3.0
syntax error
; 1.0
1
; 1.5
1
; .6
; 
; @
1
; 3.2
3
; @
3
; .6
syntax error
; 

-- 
Linux? I used ext4 for a few years. In proportion to the time spent using it, I lost as much data to it as I lost to the very worst released version of reiserfs.


^ permalink raw reply	[flat|nested] 2+ messages in thread

* Re: [9front] pc(1): integer-only entry
  2017-07-01 12:28 pc(1): integer-only entry Ethan Grammatikidis
@ 2017-07-01 12:51 ` Ethan Grammatikidis
  0 siblings, 0 replies; 2+ messages in thread
From: Ethan Grammatikidis @ 2017-07-01 12:51 UTC (permalink / raw)
  To: 9front

On Sat, Jul 1, 2017, at 01:28 PM, Ethan Grammatikidis wrote:
> pc's man page says "Pc is an arbitrary precision calculator", but it responds to my attempts to enter non-integers by reporting 'syntax error', truncating them, or outright ignoring them. if there was a way to set the precision (as in dc and bc) then at least truncation would make sense, but there's nothing on the subject in the man page. it's also inconsistent on whether it ignores or reports a syntax error.

i was confused for two reasons. pc's man page says nothing about it being integer-only, and the primary meaning of precision (and the only one in online cambridge dictionary, lol,) is "exactness" where integers imply rather coarse measurement. there is another meaning of 'precision' which is somewhat appropriate to integers. i suggest adding a word to /sys/man/1/pc, to correspond with mp(2):

- is an arbitrary precision calculator with a special emphasis on supporting two's complement bit operations and working with different number bases.
+ is an arbitrary precision integer calculator with a special emphasis on supporting two's complement bit operations and working with different number bases.


-- 
Linux? I used ext4 for a few years. In proportion to the time spent using it, I lost as much data to it as I lost to the very worst released version of reiserfs.


^ permalink raw reply	[flat|nested] 2+ messages in thread

end of thread, other threads:[~2017-07-01 12:51 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2017-07-01 12:28 pc(1): integer-only entry Ethan Grammatikidis
2017-07-01 12:51 ` [9front] " Ethan Grammatikidis

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).