M
M
Maxim Aron2017-03-08 13:33:52
JavaScript
Maxim Aron, 2017-03-08 13:33:52

Map analog from c to js?

In C, there is a map function that allows you to proportionally correctly transfer a value from a minimum to a maximum number to a value with a different minimum and maximum number. Is there something similar in js? For example, this is how it looks in C map(value, min, max, new min, new max);
arduino.com/Reference/Map

Answer the question

In order to leave comments, you need to log in

6 answer(s)
X
xutesayor, 2017-03-08
@Smiled

No, but it's easy to write your own.
https://jsfiddle.net/pzy5d9u8/

A
Andrey Stepanov, 2017-12-07
@leoykt

try switching the WiFi router to 5Ghz mode, if the interface allows it, of course. Should help a lot.

W
Wexter, 2017-12-07
@Wexter

Well, as it were, this is a normal situation when your channel is completely utilized, there are more packets than it can miss, and this is why the ping grows. turn off torrents and use cable connection instead of wifi

P
Pavel Belyaev, 2017-12-07
@PavelBelyaev

1. The speed of the router is divided by all clients connected, if there, for example, 90 megabits is squeezed out, then this is only when one is connected, with two it will already be lost, there already the priority must be configured and restrictions in order to distribute to many clients.
2. The radio channel is clogged, because. all neighbors have wifi, you can play with channels, scan the network, determine which channels are less busy, while there is also interference from neighboring channels, like there from 10 to 11, from 13 to 12 ... you need to find the most empty range, but the best the solution, of course, is 5GHz, my neighbors have only 2.4, so everything flies in general.
3. The speed of routing as a whole depends on the power of the iron inside the router and the adequacy of the firmware.
Where are you running the pings? To the router, to the provider's gateway or to the game server? With pings of 500, there may well be a speed of under 100 megabits, anything can happen.

M
Michael, 2017-12-07
@ARMADIK

I would ping on the sites, at the time of the problem. From the router, you can also start a ping in the direction of the network.
To understand where the plug is.

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question