Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

1G returns '0.06674 mm^3/(kg*s^2)' instead of '1000000000' #706

Open
ittayd opened this issue Sep 15, 2024 · 6 comments
Open

1G returns '0.06674 mm^3/(kg*s^2)' instead of '1000000000' #706

ittayd opened this issue Sep 15, 2024 · 6 comments

Comments

@ittayd
Copy link

ittayd commented Sep 15, 2024

What do I need to change so that 'G' is interpreted as 10^9? Note that 1giga works.

Related, how can I make 'K' (and not 'k') be interpreted as kilo ?

@hanna-kn
Copy link
Contributor

G is the symbol for the gravitational constant, and K for the unit Kelvin. Prefixes should ideally not be used without a unit and uppercase K is not a symbol for kilo.

The easiest way to change the interpretation of K and G is to replace the unit and constant with custom variables (e.g. using commands variable K 1000 and variable G 10^9).

@ittayd
Copy link
Author

ittayd commented Sep 15, 2024

Thanks. If I try this I either get "Do you want to overwrite it" question every time I start or need to save it in ~/.local/share/qalculate/definitions so that it then applies to all sessions. Is there a flag to say something like 'temporary' so that the overwrite prompt isn't used? I tried set save definitions no and set save mode no.

@hanna-kn
Copy link
Contributor

The simplest variant is K=1000.

@ittayd
Copy link
Author

ittayd commented Sep 15, 2024

Is there a way to make it silent, so 1000 and 1000000000 are not output ?

@ittayd
Copy link
Author

ittayd commented Sep 16, 2024

I tried passing in 'K=1000;1' as an argument and get [1000 1] as the output. I want to get only 1

hanna-kn added a commit that referenced this issue Sep 17, 2024
…re avoided (when reading commands/expression from file or in result only mode), create temporary objects for "variable" and "function" commands, do not ask before replacing object, and fail without question for illegal names; Avoid asking questions when reading commands/expressions from file before interactive mode; Fix line breaks for output from command line expression or file, before interactive mode; Update "exp" option documentation to reflect that custom negative values are allowed; "unkeep" command (reverse of "keep")
@hanna-kn
Copy link
Contributor

I tried passing in 'K=1000;1' as an argument and get [1000 1] as the output. I want to get only 1

Semicolon is used as separator for function argument, vector elements, and matrix rows (in the two first cases this is primarily relevant when comma is used as decimal or digit group separator).

If the only purpose of ";1" is to output "1" instead of "1000", save(1000, K)^0, or similar, should work.

I've now made some changes (see commit 6b60732) which should make the variable command more suited for this case.

Depending on how you use qalc, use of the clear command after the variable definitions might be an alternative.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants