<?xml version="1.0" encoding="utf-8"?>
<rss version="2.0" xmlns:atom="http://www.w3.org/2005/Atom">
	<channel>
		<title><![CDATA[Серый форум &mdash; CMD/BAT: 24-битная синусоида]]></title>
		<link>https://forum.script-coding.com/viewtopic.php?id=11609</link>
		<atom:link href="https://forum.script-coding.com/extern.php?action=feed&amp;tid=11609&amp;type=rss" rel="self" type="application/rss+xml" />
		<description><![CDATA[Недавние сообщения в теме «CMD/BAT: 24-битная синусоида».]]></description>
		<lastBuildDate>Fri, 20 May 2016 10:14:52 +0000</lastBuildDate>
		<generator>PunBB</generator>
		<item>
			<title><![CDATA[CMD/BAT: 24-битная синусоида]]></title>
			<link>https://forum.script-coding.com/viewtopic.php?pid=103974#p103974</link>
			<description><![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>]]></description>
			<author><![CDATA[null@example.com (torus)]]></author>
			<pubDate>Fri, 20 May 2016 10:14:52 +0000</pubDate>
			<guid>https://forum.script-coding.com/viewtopic.php?pid=103974#p103974</guid>
		</item>
	</channel>
</rss>
