<?xml version="1.0" encoding="utf-8"?>
<feed xmlns="http://www.w3.org/2005/Atom">
	<title type="html"><![CDATA[Серый форум &mdash; CMD/BAT: 24-битная синусоида]]></title>
	<link rel="self" href="https://forum.script-coding.com/extern.php?action=feed&amp;tid=11609&amp;type=atom" />
	<updated>2016-05-20T10:14:52Z</updated>
	<generator>PunBB</generator>
	<id>https://forum.script-coding.com/viewtopic.php?id=11609</id>
		<entry>
			<title type="html"><![CDATA[CMD/BAT: 24-битная синусоида]]></title>
			<link rel="alternate" href="https://forum.script-coding.com/viewtopic.php?pid=103974#p103974" />
			<content type="html"><![CDATA[<p>Код : </p><div class="codebox"><pre><code>@echo off
setlocal enabledelayedexpansion
if %1 gtr 26353589 (
	Echo Больше чем 2**23*pi
	exit /b
)
set /a &quot;a=5&quot;
set n=%1
	set /a &quot;series=(a * 2) + 1&quot;
	set q=!n!
	for /l %%i in (3,2,!series!) do (
		set /a &quot;plusminus=(%%i / 2) %% 2&quot;
		if !plusminus!==1 (set pms=-) else (set pms=+)
		set x=!q!
		set b=!q!
		set xe=0
		for /l %%a in (2,1,%%i) do (
			set /a &quot;x=((x &gt;&gt; 12)*(b &gt;&gt; 12))+(((x &amp; 0xFFF)*(b &gt;&gt; 12)) &gt;&gt; 12)+(((x &gt;&gt; 12)*(b &amp; 0xFFF)) &gt;&gt; 12)&quot;
			if !x! geq 16777216 (
				set /a &quot;x=x &gt;&gt; 1&quot;,&quot;xe+=1&quot;
			)
		)
		for /l %%a in (1,1,%%i) do (
			for /l %%i in (1,1,2) do (
				if !x! lss 16777216 if !xe! gtr 0 (
					set /a &quot;x=x &lt;&lt; 1&quot;,&quot;xe-=1&quot;
				)
			)
			set /a &quot;x=(x&lt;&lt;2) / %%a&quot;,&quot;xe-=2&quot;
			for /l %%i in (1,1,2) do (
				if !xe! lss 0 (
					set /a &quot;x=x &gt;&gt; 1&quot;,&quot;xe+=1&quot;
				)
			)
		)
		set /a &quot;n=n !pms! x&quot;
	)
Echo !n!
endlocal
exit /b
</code></pre></div>]]></content>
			<author>
				<name><![CDATA[torus]]></name>
				<uri>https://forum.script-coding.com/profile.php?id=33003</uri>
			</author>
			<updated>2016-05-20T10:14:52Z</updated>
			<id>https://forum.script-coding.com/viewtopic.php?pid=103974#p103974</id>
		</entry>
</feed>
