From: "Sigrid Solveig Haflínudóttir" <sigrid@ftrv.se>
To: 9front@9front.org
Subject: Re: [9front] aux/acpi divide error
Date: Thu, 15 Sep 2022 15:25:07 +0200 [thread overview]
Message-ID: <4019B0F11B0B8E2090861134A42D4845@ftrv.se> (raw)
In-Reply-To: <BC25C45758E047255291C9BFBBA90521@prosimetrum.com>
Quoth umbraticus@prosimetrum.com:
> I got a divide error after recent change.
> I guess something like this should fix it:
>
> diff e02e1188e472c7e2f40fa84e839631cc54f505a0 uncommitted
> --- a/sys/src/cmd/aux/acpi.c
> +++ b/sys/src/cmd/aux/acpi.c
> @@ -210,7 +210,7 @@
> ss = st.capacity * 3600 / st.rate;
> if(bats[n].fullcharge > 0){
> x = st.capacity * 100 / bats[n].fullcharge;
> - if(st.state & 2)
> + if(st.rate > 0 && (st.state & 2))
> ss = (bats[n].fullcharge - st.capacity) * 3600 / st.rate;
> }
> }else{
Oops. Thank you!
prev parent reply other threads:[~2022-09-15 13:27 UTC|newest]
Thread overview: 2+ messages / expand[flat|nested] mbox.gz Atom feed top
2022-09-15 10:16 umbraticus
2022-09-15 13:25 ` Sigrid Solveig Haflínudóttir [this message]
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=4019B0F11B0B8E2090861134A42D4845@ftrv.se \
--to=sigrid@ftrv.se \
--cc=9front@9front.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
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).