mersenneforum.org  

Go Back   mersenneforum.org > Factoring Projects > YAFU

Reply
 
Thread Tools
Old 2021-07-07, 20:00   #1
EdH
 
EdH's Avatar
 
"Ed Hall"
Dec 2009
Adirondack Mtns

2·33·71 Posts
Default YAFU as a calculator?

Quick question:

If I'm in YAFU and enter something like 338^53, I get a value, but from the command line, if I enter ./yafu 338^53 (with or without quotes), it starts factoring. Is there a way to just get the value from the command line?

I'm actually looking for a manner to use YAFU within a Bash script to get values that are too large for the calculator..
EdH is offline   Reply With Quote
Old 2021-07-07, 20:13   #2
bsquared
 
bsquared's Avatar
 
"Ben"
Feb 2007

22·3·293 Posts
Default

Yes, the "expression" function.

Some time ago I decided that factor() should be yafu's default action and added this function for just this reason.

Code:
./yafu "expr(338^53)"
It prints the answer to stdout like so:

Code:
ans = 107791648724516899391794749922437879901663656637741542210620810142348006207593399220450871624756179567322798904744723676640112990486528
hopefully you can use that.

Last fiddled with by bsquared on 2021-07-07 at 20:15 Reason: output
bsquared is offline   Reply With Quote
Old 2021-07-07, 21:24   #3
EdH
 
EdH's Avatar
 
"Ed Hall"
Dec 2009
Adirondack Mtns

1110111110102 Posts
Default

Thanks Ben,

This is exactly what I want. And, the -silent option works perfectly for providing just the value, so I won't have to parse.
EdH is offline   Reply With Quote
Reply

Thread Tools


Similar Threads
Thread Thread Starter Forum Replies Last Post
Aliaut Sum Calculator drmurat Aliquot Sequences 7 2020-07-01 09:28
Calculator Soup MattcAnderson Lounge 0 2019-10-29 05:19
Running YAFU via Aliqueit doesn't find yafu.ini EdH YAFU 8 2018-03-14 17:22
LL Credit Calculator swl551 Software 0 2012-12-04 17:49
Large Digit Calculator Primeinator Lounge 7 2006-02-16 23:11

All times are UTC. The time now is 07:55.


Sat Jul 31 07:55:16 UTC 2021 up 8 days, 2:24, 0 users, load averages: 1.13, 1.09, 1.14

Powered by vBulletin® Version 3.8.11
Copyright ©2000 - 2021, Jelsoft Enterprises Ltd.

This forum has received and complied with 0 (zero) government requests for information.

Permission is granted to copy, distribute and/or modify this document under the terms of the GNU Free Documentation License, Version 1.2 or any later version published by the Free Software Foundation.
A copy of the license is included in the FAQ.