|
Built-in Win 10 calculator did it for me!
|
|
|
|
|
Didn't realize the built in Windows 10 calculator used the bigint library.
|
|
|
|
|
Me too. Didn't know that the Win10 calculator was so powerful.
|
|
|
|
|
It most likely uses some infinite precision library (I once wrote one, that is not the 'bigint' one!).
It could also sum log10 for all integer from 1 to 2022, take the antilog of the fractional part of the sum and the integer part as the Ennnn value. There is a small risk of roundoff errors, but even if you have a real need for calculating 2222! you rarely need the exact value to 6474 digits of precision.
|
|
|
|
|
Surely not. Type float/double can do it, see my message below.
Luc Pattyn [My Articles]
The Windows 11 "taskbar" is disgusting. It should be at the left of the screen, with real icons, with text, progress, etc. They downgraded my developer PC to a bloody iPhone.
|
|
|
|
|
Amarnath S wrote: nd am not sure of how to arrive at this You make it homework.
Bastard Programmer from Hell
"If you just follow the bacon Eddy, wherever it leads you, then you won't have to think about politics." -- Some Bell.
|
|
|
|
|
Back of the napkin estimate: around 7000.
Reasoning: number of digits is given by log10. Stiriling formula mentioned by Peter says something like n!= O(n^n) (don't remember the whole formula and we are on the back of the napkin with no Google ). That makes number of digits 2222*log10(2222). The log is 3 and a bit (log10(1000) is 3 plus log10(2)). That puts the number of digits around 6666. Allowing for the lost factors in Stirling approximation, 7000 looks like a reasonable estimate.
EDIT: after the back-of-the-napkin estimate, I used the Win10 calculator to find the correct answer: 6473. Also rechecked the Stirling formula. Main reason for the difference is the 1/e^n factor that was missing in my estimate. Anyway a nice brain rinsing exercise
Mircea
modified 20-Jan-22 9:48am.
|
|
|
|
|
Really good estimate until you rounded it. According to the Windows 10 calculator, it's 3.4310637869208214326346682154289e+6473
|
|
|
|
|
Simple, you don't need integers, not even BigInteger. Try
double val = 1;
int pow10 = 0;
for (int i = 1; i <= 2222; i++) {
val *= i;
while (val > 10) {
val /= 10.0;
pow10++;
}
}
log("val=" + val + "; pow10=" + pow10);
you'll get
val=3.43106378692083; pow10=6473
Luc Pattyn [My Articles]
The Windows 11 "taskbar" is disgusting. It should be at the left of the screen, with real icons, with text, progress, etc. They downgraded my developer PC to a bloody iPhone.
|
|
|
|
|
I bet you are a very good driver and always keep the vehicle well within the margins of the lane.
Great approach.
|
|
|
|
|
Nope, I use all lanes available, and then some.
Luc Pattyn [My Articles]
The Windows 11 "taskbar" is disgusting. It should be at the left of the screen, with real icons, with text, progress, etc. They downgraded my developer PC to a bloody iPhone.
|
|
|
|
|
using base #1, the factual of #2222 will take #222 hands and two feet.
«The mind is not a vessel to be filled but a fire to be kindled» Plutarch
|
|
|
|
|
So I ordered a package from Japan, some CD's (soundtracks that I can't buy in The Netherlands).
I just got a payment request from UPS, customs that I have to pay since last year I think, mainly implemented to stop people from buying cheap stuff from China.
The total fee is even more than the 21% VAT and I'm pretty sure that VAT was already included in the original price (but there's no way to check), but sure, I really have no other choice.
So I get an SMS, which I open on my phone, naturally, and follow the link in that text.
The following UPS page is not at all optimized for mobile viewing.
I have to put on my glasses, scroll left and right, zoom in and out, get a tiny finger transplant, you know the deal.
After finally filling out the form I get a message that IPPA is unavailable at this time, please try again later
Maybe UPS should spend some of its billions of profits from last year into making the page they send through SMS mobile friendly and making sure their services are available
For the money I'm paying I'd expect my package to be delivered in a golden carriage on a satin cushion, not this screw up
|
|
|
|
|
The collection fee being more than the import taxes has also happened in Canada, though it seems to have improved lately. And if they sent you an SMS, there's no excuse for not having a mobile-friendly website. But what really pisses me off are sites that assume that everyone has a smartphone for 2FA. My US and Canadian banks have enough sense to offer a passcode by voice. But GitHub, for one, is clueless.
|
|
|
|
|
Sounds like a classic mafia shake-down to me.
|
|
|
|
|
Nah, I really expected this package from that exact company.
The amount also more or less checks out with what I expected.
Also, I'd expect a scammer to have a more professional website as to not raise suspicion
|
|
|
|
|
I order products from Japan all the time via Amazon, and I have never had to pay extra money outside of what I paid through Amazon.
Interesting that you have to pay an extra fee of any kind.
|
|
|
|
|
Yeah, it's tax imposed by the Dutch government to anything not coming from EU countries.
Basically, when I order a product from outside the EU, I'm not paying VAT.
Likewise, when I'm shipping products outside the EU, I don't have to charge VAT and I don't have to pay it to my government.
That gives businesses from outside the EU, like America, but more importantly China, an unfair advantage over businesses from the EU, because they're 21% cheaper even without factoring in that those products are cheaper anyway (that's why it's mostly China, since you can find anything for cheap on Alibaba, while countries like the USA, England, Canada or Australia aren't necessarily cheaper + delivery times are a lot longer).
As a countermeasure the government is now taxing everything from outside the EU.
Got it first around two years ago, was pretty surprised*.
After that I didn't have to pay a couple of times, but now they've made it a law or some such**.
* Really not a scam, had to pay it at my local postal office.
** Still not a scam, I know they really did that and the payment requests come from the Dutch delivery services for packages I really expect.
|
|
|
|
|
First imposed two years ago - sounds like a Brexit tax to me. The lead EU Brexit negotiator was from the Netherlands and he admitted publicly that his goal was to penalize the UK and turn them into an EU vassal state.
|
|
|
|
|
The package is from Japan and it's a Dutch tax (afaik).
I have no idea how Brexit fits into this
|
|
|
|
|
I believe it is a EU directive/law - so not something the Dutch government decided on it's own.
At least AliExpress are on top of this and collect the tax when you order - so no extra fee and custom delays, just the tax which doesn't really matter for something so cheap that I am willing to buy it from China.
|
|
|
|
|
Correct. Everything from outside the EU, unless the vendor has already charged the TVA, will go through customs, which will cost an additional:
- TVA (based on destination country)
- custom charge if value+shipping exceeds 150€
- courier's handling costs (typ 15€) if the courier gets involved in advancing and handling these charges
Also the "no charge for anything below 22€" rule ended 01-JUL-2021.
Luc Pattyn [My Articles]
The Windows 11 "taskbar" is disgusting. It should be at the left of the screen, with real icons, with text, progress, etc. They downgraded my developer PC to a bloody iPhone.
|
|
|
|
|
I hope you triple-checked the URL before giving them your payment details - this sounds like a typical "postage due" scam to me.
"These people looked deep within my soul and assigned me a number based on the order in which I joined."
- Homer
|
|
|
|
|
Nah, I really expected this package from that exact company.
The amount also more or less checks out with what I expected.
Also, I'd expect a scammer to have a more professional website as to not raise suspicion
|
|
|
|
|
Yeah, that sounds scammy.
There's no reason the delivery service would charge that -- on the behalf of customs? The delivery service is just a middle-man.
But a bad site is a bad site.
|
|
|
|